package com.atguigu.day21.other06;

import org.junit.Test;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2024/11/26 17:07
 * @注释
 */
public class ScannerTest {
    @Test
    public void test() throws FileNotFoundException, InterruptedException {
        Scanner sc = new Scanner(new File("D:\\年度最佳小说.txt"));


          while (sc.hasNextLine()){
            System.out.println(sc.nextLine());
            Thread.sleep(1000);
        }

        sc.close();
    }
}
